<template>
	<div class="oneHeader">
		<!-- 企业详情照片 -->
		<div class="companyImg">
			<img v-if="detailsList.iconurl" :src="detailsList.iconurl" alt="">
			<img v-else src="../../../public/images/enterprise/company.png" alt="">
		</div>
		<!-- 企业详情头部详情 -->
		<div class="companyContent">
			<div class="companyname">{{detailsList.company_name}}</div>
			<div class="companyprize">
				<div v-if="detailsList.qualified_name">
					<span v-for="item in detailsList.qualified_name.split(',')" v-if="item!=''">{{item}}</span>
					<!-- <span>冠军企业</span>
					<span>永磁稀土</span> -->
					<a v-if="detailsList.qualified_name.split(',').length>5">更多</a>
				</div>
				
			</div>
			<div class="companytime">{{detailsList.update_time}} 更新</div>
			<div class="companyposition">
				<div class="company_phone">
					<span>电话：{{detailsList.phone}}</span>
					<span>官网：{{detailsList.homeurl}}</span>
				</div>
				<div class="company_address">
					地址：{{detailsList.reg_address}}
				</div>
				<div class="company_jianjie">
						简介：
					<div class="jianjie_content " :class="showText?'active':''">
					{{detailsList.describer}}	
					</div>
					<span v-if="showText" @click="toShow(false)">展开</span>
					<span v-else @click="toShow(true)">收起</span>
				</div>
			</div>
		</div>
		<div class="company_back" @click="goBack()">
			返回
		</div>
	</div>
</template>

<script>
	export default{
		props:['baseData'],
		data() {
			return{
				detailsList:[],
				showText:true,
			}
		},
		// 监听从enterpriseOne获取的头部数据
		watch:{
			baseData:{
            handler(val){
                this.detailsList = val
            },
            deep:true,
						immediate:true
        }, 
		},
		methods:{
			goBack(){
				this.$router.push('/enterprisePage')
			},
			toShow(e){
				this.showText=e
			}
		}
	}
</script>

<style lang="stylus" rel='stylesheet/stylus' scoped>
	@import "~@/assets/oneHeader.styl"
</style>
